package com.shyb.lingxian.netWork;

import com.shyb.lingxian.mine.bean.LoginBean;
import com.shyb.lingxian.mine.bean.TicketBean;


import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;


/**
 * Created by gs on 2018/3/23.
 */

public interface NetWorkServices {


   //获取Ticket
   @FormUrlEncoded @POST("/cas/mobile/getticket.html")
   Observable<TicketBean> getTicket(
           @Field("secret") String secret,
           @Field("nonce") String nonce,
           @Field("curTime") String curTime,
           @Field("checkSum") String checkSum
   );

    //发送验证码
    @FormUrlEncoded @POST("/cas/mobile/sendSmsByPhone")
    Observable<TicketBean> SendCode(
            @Field("secret") String secret,
            @Field("nonce") String nonce,
            @Field("curTime") String curTime,
            @Field("checkSum") String checkSum,
            @Field("ticket") String ticket,
            @Field("phone") String phone
    );


    //登录
    @FormUrlEncoded @POST("/cas/mobile/sendSmsByPhone")
    Observable<LoginBean> Login(
            @Field("secret") String secret,
            @Field("nonce") String nonce,
            @Field("curTime") String curTime,
            @Field("checkSum") String checkSum,
            @Field("ticket") String ticket,
            @Field("phone") String phone,
            @Field("code") String code
    );



    //保存新地址
    @FormUrlEncoded @POST("/m/auth/shipping/add")
    Observable<LoginBean> SaveNewAddress(
            @Field("secret") String secret,
            @Field("nonce") String nonce,
            @Field("curTime") String curTime,
            @Field("checkSum") String checkSum,
            @Field("ticket") String ticket,
            @Field("receiverName") String receiverName,
            @Field("receiverPhone") String receiverPhone,
            @Field("receiverProvince") String receiverProvince,
            @Field("receiverAddress") String receiverAddress,
            @Field("shippingCategory") String shippingCategory
    );

    //退出
    @FormUrlEncoded @POST("/cas/mobile/sendSmsByPhone")
    Observable<LoginBean> Gitout(
            @Field("secret") String secret,
            @Field("nonce") String nonce,
            @Field("curTime") String curTime,
            @Field("checkSum") String checkSum,
            @Field("ticket") String ticket,
            @Field("phone") String phone,
            @Field("code") String code
    );




    //意见反馈
    @FormUrlEncoded @POST("/m/auth/user/feedback")
    Observable<LoginBean> FanKui(
            @Field("secret") String secret,
            @Field("nonce") String nonce,
            @Field("curTime") String curTime,
            @Field("checkSum") String checkSum,
            @Field("ticket") String ticket,
            @Field("id") String id,
            @Field("feedBack") String feedBack
    );
}
